notebook: Set the current page when none is set
authorBenjamin Otte <otte@redhat.com>
Sat, 19 Dec 2015 05:56:04 +0000 (06:56 +0100)
committerBenjamin Otte <otte@redhat.com>
Mon, 11 Jan 2016 16:05:22 +0000 (17:05 +0100)
This case happens when you gtk_widget_show_all (notebook).

gtk/gtknotebook.c

index ce05f75a68cfca312bf708685bb3cd911f6a10d0..f43b7da712c0c2b8f8dc25006264c9e91817ccfe 100644 (file)
@@ -4771,6 +4771,13 @@ page_visible_cb (GtkWidget  *child,
       if (next)
         gtk_notebook_switch_page (notebook, GTK_NOTEBOOK_PAGE (next));
     }
+  
+  if (!priv->cur_page && gtk_widget_get_visible (child))
+    {
+      gtk_notebook_switch_page (notebook, page);
+      /* focus_tab is set in the switch_page method */
+      gtk_notebook_switch_focus_tab (notebook, priv->focus_tab);
+    }
 }
 
 static gint